class Book < ActiveRecord::Base
   
    attr_accessible :author, :barcode, :publisher, :rate, :rate_number, :title, :category, :version, :year, :image,:description, :quantity
    validates_presence_of :title
    validates_presence_of :author
    validates_presence_of :category
    validates_uniqueness_of :barcode
    
    has_attached_file :image,  :styles => {
     :thumb => "100x100#",
     :small  => "150x150>",
     :medium => "200x200" },
     
    :default_url => '/uploads/missing.jpg',
    :url => "/uploads/:id/:style/:basename.:extension",
    :path => "public/uploads/:id/:style/:basename.:extension"
    
end
